part of 'component.dart';

class ExpandedButton extends StatelessWidget {
  const ExpandedButton({
    Key? key,
    required this.text,
    this.textColor,
    this.fontSize,
    this.backgroundColor,
    this.height,
    this.indent = 0,
    this.onPressed,
  }) : super(key: key);
  final String text;
  final Color? textColor;
  final double? fontSize;
  final Color? backgroundColor;
  final double? height;
  final double? indent;
  final VoidCallback? onPressed;
  @override
  Widget build(BuildContext context) {
    var _height = height ?? buttonHeight;
    return Row(
      children: [
        SizedBox(
          width: indent,
        ),
        Expanded(
            child: MaterialButton(
          onPressed: onPressed,
          height: _height,
          color: backgroundColor ?? ColorsUtil.blue,
          disabledColor: backgroundColor ?? ColorsUtil.blue,
          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
          child: Text(
            text,
            style: pfSCStyle(
                color: textColor ?? ColorsUtil.white,
                fontSize: fontSize ?? 18.sp),
          ),
        )),
        SizedBox(
          width: indent,
        ),
      ],
    );
  }
}
